<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>新增疫苗接种信息- 萌迹(Cute Trial Admin)后台管理系统</title>
<link rel="icon" href="petvet.ico" type="image/ico">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/materialdesignicons.min.css" rel="stylesheet">
<!--标签插件-->
<link rel="stylesheet" href="js/jquery-tags-input/jquery.tagsinput.min.css">
<link href="css/style.min.css" rel="stylesheet">
</head>
  
<body>
<div class="container-fluid p-t-15">
  
  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-body">
          
          <form action="#!" method="post" class="row">
            <div class="form-group col-md-12">
              <label for="doctorName">宠物信息</label>
              <input type="text" class="form-control" id="doctorName" name="doctorName" value="" placeholder="请输入姓名" />
            </div>
            <div class="form-group col-md-12">
              <label for="gender">疫苗名称</label>
              <input type="text" class="form-control" id="gender" name="gender" value="" placeholder="M/F"/>
            </div>
            <div class="form-group col-md-12">
              <label for="doctorPhone">疫苗类型</label>
              <input type="text" class="form-control" id="doctorPhone" name="doctorPhone" value="" placeholder="138****3958"/>
            </div>
            <div class="form-group col-md-12">
              <label for="department">接种日期</label>
              <input type="text" class="form-control" id="department" name="department" value="" placeholder="住院部/门诊部/..."/>
            </div>
            <div class="form-group col-md-12">
              <label for="title">有效期至</label>
              <input type="text" class="form-control" id="title" name="title" value="" placeholder="护士/医生/..."/>
            </div>
            <div class="form-group col-md-12">
              <label for="specialty">接种医生</label>
              <input type="text" class="form-control" id="specialty" name="specialty" value="" placeholder="负责..." />
            </div>
            <div class="form-group col-md-12">
              <label for="hireDate">批号</label>
              <input type="text" class="form-control" id="hireDate" name="hireDate" value="" placeholder="yyyy-xx-zz" />
            </div>
            <div class="form-group col-md-12">
              <label for="hireDate">备注</label>
              <input type="text" class="form-control" id="hireDate" name="hireDate" value="" placeholder="yyyy-xx-zz" />
            </div>
            <div class="form-group col-md-12">
              <button type="button" onclick="addDoctorInfo()" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
              <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>
          </form>
 
        </div>
      </div>
    </div>
    
  </div>
  
</div>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!--标签插件-->
<script src="js/jquery-tags-input/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>
<script type="text/javascript">
<!--定义添加方法-->
function addDoctorInfo() {
  <!-- 封装提交参数 -->
      var params = {
      "doctorName": $("#doctorName").val(),
      "gender": $("#gender").val(),
      "doctorPhone": $("#doctorPhone").val(),
      "department": $("#department").val(),
      "title": $("#title").val(),
      "specialty": $("#specialty").val(),
      "hireDate": $("#hireDate").val()
  };


<!--添加用户信息-->
  $.getJSON("http://localhost:8080/pethospital/doctorInfo/add", params,
        function(riv) {
  if (riv.code == 1) {
    alert("添加成功");
    location.href = "pet_doc_id.html";
  } else {
    alert(data.msg);
  }
});
}
</script>
</body>
</html>